package com.zch.domain;

import com.zch.handler.ResponseHandler;
import lombok.Data;

import java.io.Serializable;

/**
* @description: TODO
* @author 86134
* @date 2023/10/30 18:45
* @version 1.0
*/
@Data
public class Result implements Serializable {
    private Integer code;
    private String message;
    private Object data;

    private Result(){}

    public static Result SUCCESS(){
        Result result = new Result();
        result.code= ResponseHandler.DO_SUCCESS;
        return result;
    }
    public static Result SUCCESS(Object data){
        Result result = new Result();
        result.code= ResponseHandler.DO_SUCCESS;
        result.data=data;
        return result;
    }
    public static Result FAILED(Integer code,String message){
        Result result = new Result();
        result.code= code;
        result.message=message;
        return result;
    }
}
